\(\int \frac {\cot (c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx\) [302]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 32, antiderivative size = 12 \[ \int \frac {\cot (c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {B \log (\sin (c+d x))}{d} \]

[Out]

B*ln(sin(d*x+c))/d

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {21, 3556} \[ \int \frac {\cot (c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {B \log (\sin (c+d x))}{d} \]

[In]

Int[(Cot[c + d*x]*(a*B + b*B*Tan[c + d*x]))/(a + b*Tan[c + d*x]),x]

[Out]

(B*Log[Sin[c + d*x]])/d

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = B \int \cot (c+d x) \, dx \\ & = \frac {B \log (\sin (c+d x))}{d} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(25\) vs. \(2(12)=24\).

Time = 0.02 (sec) , antiderivative size = 25, normalized size of antiderivative = 2.08 \[ \int \frac {\cot (c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=B \left (\frac {\log (\cos (c+d x))}{d}+\frac {\log (\tan (c+d x))}{d}\right ) \]

[In]

Integrate[(Cot[c + d*x]*(a*B + b*B*Tan[c + d*x]))/(a + b*Tan[c + d*x]),x]

[Out]

B*(Log[Cos[c + d*x]]/d + Log[Tan[c + d*x]]/d)

Maple [A] (verified)

Time = 0.17 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.08

method result size
derivativedivides \(\frac {B \ln \left (\sin \left (d x +c \right )\right )}{d}\) \(13\)
default \(\frac {B \ln \left (\sin \left (d x +c \right )\right )}{d}\) \(13\)
parallelrisch \(\frac {B \left (2 \ln \left (\tan \left (d x +c \right )\right )-\ln \left (\sec ^{2}\left (d x +c \right )\right )\right )}{2 d}\) \(28\)
norman \(\frac {B \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {B \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) \(31\)
risch \(-i B x -\frac {2 i B c}{d}+\frac {B \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) \(32\)

[In]

int(cot(d*x+c)*(B*a+b*B*tan(d*x+c))/(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

B*ln(sin(d*x+c))/d

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.67 \[ \int \frac {\cot (c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {B \log \left (-\frac {1}{2} \, \cos \left (2 \, d x + 2 \, c\right ) + \frac {1}{2}\right )}{2 \, d} \]

[In]

integrate(cot(d*x+c)*(B*a+b*B*tan(d*x+c))/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/2*B*log(-1/2*cos(2*d*x + 2*c) + 1/2)/d

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 49 vs. \(2 (10) = 20\).

Time = 0.50 (sec) , antiderivative size = 49, normalized size of antiderivative = 4.08 \[ \int \frac {\cot (c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\begin {cases} - \frac {B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {B \log {\left (\tan {\left (c + d x \right )} \right )}}{d} & \text {for}\: d \neq 0 \\\frac {x \left (B a + B b \tan {\left (c \right )}\right ) \cot {\left (c \right )}}{a + b \tan {\left (c \right )}} & \text {otherwise} \end {cases} \]

[In]

integrate(cot(d*x+c)*(B*a+b*B*tan(d*x+c))/(a+b*tan(d*x+c)),x)

[Out]

Piecewise((-B*log(tan(c + d*x)**2 + 1)/(2*d) + B*log(tan(c + d*x))/d, Ne(d, 0)), (x*(B*a + B*b*tan(c))*cot(c)/
(a + b*tan(c)), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 29 vs. \(2 (12) = 24\).

Time = 0.35 (sec) , antiderivative size = 29, normalized size of antiderivative = 2.42 \[ \int \frac {\cot (c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=-\frac {B \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 2 \, B \log \left (\tan \left (d x + c\right )\right )}{2 \, d} \]

[In]

integrate(cot(d*x+c)*(B*a+b*B*tan(d*x+c))/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

-1/2*(B*log(tan(d*x + c)^2 + 1) - 2*B*log(tan(d*x + c)))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 59 vs. \(2 (12) = 24\).

Time = 0.33 (sec) , antiderivative size = 59, normalized size of antiderivative = 4.92 \[ \int \frac {\cot (c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {B \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) - 2 \, B \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right )}{2 \, d} \]

[In]

integrate(cot(d*x+c)*(B*a+b*B*tan(d*x+c))/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

1/2*(B*log(abs(-cos(d*x + c) + 1)/abs(cos(d*x + c) + 1)) - 2*B*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1)
+ 1)))/d

Mupad [B] (verification not implemented)

Time = 7.01 (sec) , antiderivative size = 27, normalized size of antiderivative = 2.25 \[ \int \frac {\cot (c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=-\frac {B\,\left (\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )-2\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\right )}{2\,d} \]

[In]

int((cot(c + d*x)*(B*a + B*b*tan(c + d*x)))/(a + b*tan(c + d*x)),x)

[Out]

-(B*(log(tan(c + d*x)^2 + 1) - 2*log(tan(c + d*x))))/(2*d)